using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DTO;

namespace DAO
{
    public class PhuCapDAO
    {
        public DataTable sp_LayPhuCapMotNhanVien(string MaNhanVien)
        {
            List<SqlParameter> listParam = new List<SqlParameter>();
            listParam.Add(new SqlParameter("@MaNhanVien", MaNhanVien));

            return sqlDAO.ExecuteQuery("sp_LayPhuCapMotNhanVien", listParam);
        }
        public void sp_ThemPhuCap(PhuCapDTO PhuCap)
        {
            List<SqlParameter> listParam = new List<SqlParameter>();
            listParam.Add(new SqlParameter("@TenPhuCap", PhuCap.TenPhuCap));
            listParam.Add(new SqlParameter("@SoTienPhuCap", PhuCap.SoTienPhuCap));
            listParam.Add(new SqlParameter("@MaNhanVien", PhuCap.MaNhanVien));
            listParam.Add(new SqlParameter("@NgayPhuCap", PhuCap.NgayPhuCap));
            sqlDAO.ExecuteNoneQuery("sp_ThemPhuCap", listParam);
        }
        public void sp_XoaPhuCap(int MaPhuCap)
        {
            List<SqlParameter> listParam = new List<SqlParameter>();
            listParam.Add(new SqlParameter("@MaPhuCap",MaPhuCap));
            sqlDAO.ExecuteNoneQuery("sp_XoaPhuCap", listParam);
        }
        public void sp_CapNhatPhuCap(PhuCapDTO PhuCap)
        {
            List<SqlParameter> listParam = new List<SqlParameter>();
            listParam.Add(new SqlParameter("@MaNhanVien", PhuCap.MaNhanVien));
            listParam.Add(new SqlParameter("@MaPhuCap", PhuCap.MaPhuCap));
            listParam.Add(new SqlParameter("@TenPhuCap", PhuCap.TenPhuCap));
            listParam.Add(new SqlParameter("@NgayPhuCap", PhuCap.NgayPhuCap));
            listParam.Add(new SqlParameter("@SoTienPhuCap", PhuCap.SoTienPhuCap));
            sqlDAO.ExecuteNoneQuery("sp_CapNhatPhuCap", listParam);
        }
    }
}
